home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NetNews Offline 2
/
NetNews Offline Volume 2.iso
/
news
/
comp
/
std
/
c
/
713
< prev
next >
Wrap
Internet Message Format
|
1996-08-06
|
1KB
Path: solon.com!not-for-mail
From: seebs@solutions.solon.com (Peter Seebach)
Newsgroups: comp.std.c
Subject: va_list, function calls.
Date: 9 Apr 1996 07:11:43 -0500
Organization: Usenet Fact Police (Undercover)
Message-ID: <4kdk5v$mn@solutions.solon.com>
Reply-To: seebs@solon.com
NNTP-Posting-Host: solutions.solon.com
I am unclear on the language in the standard describing this.
Consider:
void foo(int bar, ...) {
va_list ap;
int i;
va_start(ap, bar);
for (i = 0; i < bar; ++i)
baz(&ap);
va_end(ap);
}
void baz(va_list *ap) {
printf("%d\n", va_arg(*ap));
}
Assuming that foo is called like
foo(1, 1);
foo(2, 18, 23);
...
is this legal?
If not, is there a compelling reason?
I have a proposal in the works for printf() enhancements, but the
obvious implementation would basically require that it be possible
for a function with a va_list to safely have a child function access
and modify that va_list. The standard's wording appears to me to
apply only to passing the list itself, not its address.
-s
--
Peter Seebach - seebs@solon.com - Copyright 1996 Peter Seebach.
C/Unix wizard -- C/Unix questions? Send mail for help. No, really!
FUCK the communications decency act. Goddamned government. [literally.]
The *other* C FAQ - http://www.solon.com/~seebs/c/c-iaq.html